/**
 * Camera.h
 *
 * Author:
 *   Chris Herbison
 *
 * Description:
 *   Header file for the Camera class.
 */

#ifndef CAMERA_H
#define CAMERA_H

#include "Rectangle.h"
#include "vecmath.h"
#include "World.h"

//const MyColor BG_COLOR(0.5, 0.7, 0.7, 0);
const MyColor BG_COLOR(0.0, 0.0, 0.0, 0);
const double EPSILON = 0.0000000000000001;

class Camera{
     public:
          Camera(Point3 _position, Vector3 _lookAt, Vector3 _up, double _Lmax, bool toneType, double _Lwa = 0, double _toneA = 0.18);
		  void distributeRadiantEnergy(vector<Rectangle*> sceneRectangles, size_t iterations);
          void render(World w);

          Point3 position;
          Vector3 lookAt, up;
          vector<MyColor> screen;
     private:
          void perceptualToneReproduction(MyColor *iColor);
          void photographicToneReproduction(MyColor *iColor);
          void calculateLwa();
          void calculateSf();
          double luminance(MyColor lColor);
          double Lmax, toneA, scaleFactor, Lwa;
          bool useWard;
};

#endif
